import { $put, $get, $post } from '@js/request';
import { FileSchema } from '@src/components/schema/fileSchema';
export async function updateRequest (d: { [k: string]: any }): Promise<void> {
  const id = d.id
  const res = await $put(`/api/commission/meeting/${id}`, d)
  return res.data
}
export async function getDocRequest (id: string): Promise<FileSchema>  {
  const res = await $post(`/api/commission/meeting/createMeetingTemp/${id}`)
  return res.data
}

export interface VideoSchema {
  "uuID": string,
  "confUUID": string,
  "confID": string,
  "url": string[],
  "rcdTime": number,
  "rcdSize": number,
  "subject": string,
  "scheduserName": string,
  "startTime": string,
  "isDecodeFinish": boolean,
  "decodeEndTime": number,
  "available": boolean,
  "recordAuthType": number,
  "confMode": string,
  "recordStatus": number,
  "isBackup": boolean
}

export interface VideoResponseSchema { total: number, list: VideoSchema[] }

export async function getVideoRequest (meetingid: string): Promise<VideoResponseSchema> {
  const res = await $get('/api/commission/meeting/recordsPlayers', {
    meetingid
  })
  return res.data
}